<?php

namespace App\Models\User;

use Eloquent;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Carbon;

/**
 * App\Models\User\WechatMiniAppUser
 *
 * @property int         $id
 * @property string      $user_id 用户id
 * @property string      $openid  微信openid
 * @property Carbon|null $created_at
 * @property Carbon|null $updated_at
 * @property string      $appid   appid
 * @method static Builder|WechatMiniAppUser newModelQuery()
 * @method static Builder|WechatMiniAppUser newQuery()
 * @method static Builder|WechatMiniAppUser query()
 * @method static Builder|WechatMiniAppUser whereAppid($value)
 * @method static Builder|WechatMiniAppUser whereCreatedAt($value)
 * @method static Builder|WechatMiniAppUser whereId($value)
 * @method static Builder|WechatMiniAppUser whereOpenid($value)
 * @method static Builder|WechatMiniAppUser whereUpdatedAt($value)
 * @method static Builder|WechatMiniAppUser whereUserId($value)
 * @mixin Eloquent
 */
class WechatMiniAppUser extends Model
{
    use HasFactory;

    protected $table = 'user_wechat_miniapp';
    protected $fillable
                     = [
            'user_id',
            'openid',
            'appid',
        ];

    public function getUserId()
    {
        return $this->getAttribute('user_id');
    }

    public function getOpenId()
    {
        return $this->getAttribute('openid');
    }

    public function getAppId()
    {
        return $this->getAttribute('appid');
    }
}
